package com.leo.study.mybatis.controller;


import com.leo.study.mybatis.service.AdminService;
import com.leo.util.json.FastJsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liusl
 * @date 2019/1/21-16:45
 */
@Controller
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    @ResponseBody
    @RequestMapping("/first")
    public String admin() {
        return FastJsonUtil.toJSONString(adminService.getById(1L));
    }

}
